<!DOCTYPE HTML>
<html> 
<%@ page language="java" contentType="text/html; charset=UTF-8"	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="perm" uri="/WEB-INF/tld/perm.tld"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<script>
	var ctx="${ctx}";
</script>

<head>
	<meta charset="utf-8">
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
	<meta http-equiv="Cache-Control" content="no-siteapp" />
	<link href="${ctx}/static/css/bootstrap.css?v=${static_version}/" rel="stylesheet">
	<link href="${ctx}/static/css/font-awesome.min.css" rel="stylesheet" />
	<link href="${ctx}/static/css/animate.min.css?v=${static_version}" rel="stylesheet" />
	<link href="${ctx}/static/css/style.min.css?v=${static_version}" rel="stylesheet" />
	<link href="${ctx}/static/css/common.css?v=${static_version}" rel="stylesheet" />
	<link href="//at.alicdn.com/t/font_9x03jhokyws9vn29.css" rel="stylesheet">
	<!-- 插件样式  -->
	<link href="${ctx}/static/css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet" />
	<link href="${ctx}/static/css/plugins/webuploader/webuploader.css" rel="stylesheet" />
	<link href="${ctx}/static/css/plugins/markdown/bootstrap-markdown.min.css" rel="stylesheet" />
	<link href="${ctx}/static/css/plugins/datapicker/datepicker3.css" rel="stylesheet">
	<link href="${ctx}/static/plugins/region/css/city-picker.css" rel="stylesheet" type="text/css" />
    
</head>
<title>发布新发现供应</title>

<body class="gray-bg">
	<div class="wrapper wrapper-content  animated fadeInRight">
	   	<div class="ibox float-e-margins">
	   		<div class="ibox-title">
       			<h5>发布新发现供应<small></small></h5>
	 		</div>
	   		<div class="ibox-content">
	            <form class="form-group" id="member_table_form" method="post" action="${ctx}/u_service_discover-add">	
		            <div class="row">
	            		<div class="form-horizontal">
	                       <div class="form-group">
	                       <input type="hidden" id="id" name="id" value='${u_discover.id}' />
	                           <label class="col-sm-2 control-label" >供应分类：</label>
	
	                           <div class="col-sm-10">
		                           <div class="col-sm-4 m-l-n">
		                               <select name="cateId" class="form-control" >
											<option value="-1">----</option>
											<c:forEach items="${cates}" var="cate">
											<option value="${cate.id}" <c:if test="${cate.id==u_discover.activity_type}">selected</c:if> >${cate.cate_name}</option>
											</c:forEach>
										</select>
									</div>
									<%-- <div class="col-sm-4 m-l-n">
									<input type="checkbox" id="is_add" style="min-width:0px" name="is_add" value="0" <c:if test="${u_discover.is_add==1}">checked</c:if>><label for="is_add" style="margin-bottom:-5px">放入商业供需</label>
									</div> --%>
	                           </div>
	                       </div>	                       
	                       
	                       <input type="hidden" class="form-control" id="head_img" name="head_img" value="${u_discover.head_img}" />
							<div class="form-group webuploader2" id="uploader">
								<label class="col-sm-2 control-label">供应海报：</label>
								<div class="col-sm-10 ">						
									<div  class="col-sm-2 m-l-n">
										<a id="filePicker_covers"><i class="iconfont icon-plus1"></i></a>					
									</div>
									
									<div id="fileList_covers" class="col-sm-2 uploader-list">
									<c:if test="${!empty u_discover.head_img}">
										<img src="${u_discover.head_img}" height="100" border="0" />
									</c:if>
									</div>										
								</div>					
							</div>
	                       
	                       <div class="form-group">
	                        	<input type="hidden" class="form-control" id="vedio" name="vedio" value="${u_discover.vedio}" />
	                           	<label class="col-sm-2 control-label" >添加音乐：</label>
	                           	<div class="col-sm-10 ">						
									<div  class="col-sm-2 m-l-n">
										<a id="iconbutton"><i class="iconfont icon-plus1"></i></a>					
									</div>									
									<div id="fileList_covers_vedio" class="col-sm-2 uploader-list_vedio">
									<c:if test="${!empty u_discover.vedio}">
										<audio controls='controls'><source src='${u_discover.vedio}' type='audio/mpeg'></audio>
									</c:if>
									</div>										
								</div>	                           
	                        </div>
	                       <div class="form-group">
	                           <label class="col-sm-2 control-label" >供应名称：</label>
	
	                           <div class="col-sm-10">
	                           		<div class="col-sm-4 m-l-n">
		                           		<input type="text" class="form-control" value="${u_discover.title}" placeholder="" id="title" name="title" datatype="*" nullmsg="不能为空">
		                           	</div>
	                           </div>
	                       </div>
	                       <div class="form-group">
	                           <label class="col-sm-2 control-label" >投放地区：</label>
	
	                           <div class="col-sm-10">
	                           		<div class="col-sm-4 m-l-n">
		                           		<input id="city-picker3" class="form-control" readonly name="regioninfo" type="text" value="${u_discover.city}" data-toggle="city-picker">
		                           	</div>
	                           </div>
	                       </div>
	                       <div class="form-group">
	                           <label class="col-sm-2 control-label" >详细地址：</label>
	
	                           <div class="col-sm-10">
	                           		<div class="col-sm-4 m-l-n">
		                           		<input type="text" class="form-control" value="${u_discover.address}" placeholder="" id="address" name="address" datatype="*" nullmsg="不能为空">
		                           	</div>
	                           </div>
	                       </div>
	                       <div class="form-group">
	                           <label class="col-sm-2 control-label" >起始时间：</label>
	
	                           <div class="col-sm-10">
	                           		<div class="col-sm-4 m-l-n">
		                           		<input type="text" class="input-md form-control layer-date" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" value="${u_discover.begin_time}" placeholder="起始时间" id="begin_time" name="begin_time">
		                           	</div>
	                           </div>
	                       </div>
	                       <div class="form-group">
	                           <label class="col-sm-2 control-label" >结束时间：</label>
	
	                           <div class="col-sm-10">
	                           		<div class="col-sm-4 m-l-n">
		                           		<input type="text" class="input-md form-control layer-date" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" value="${u_discover.end_time}" placeholder="结束时间" id="end_time" name="end_time" >
		                           	</div>
	                           </div>
	                       </div>
	                       <div class="form-group">
								<label class="col-sm-2 control-label" >供应说明：</label>
								<div class="col-sm-8">
							 		<textarea name="description"  id="description" data-provide="markdown" rows="5" class="textarea"
									placeholder="说点什么...最少输入10个字符" datatype="*0-200" dragonfly="true"
									nullmsg="备注不能为空！" onKeyUp="textarealength(this,200)">${u_discover.description}</textarea>
							 	</div>
						   </div>
						   
						   
	                       <div class="ibox-content2">
	                       <div  class="hr-line-solid2"  ></div>
	                       <div class="ibox-title2" >
	                       <div class="col-sm-8 fl" ><b class="b1" >服务费用</b></div>
	                       
	                      <div class="col-sm-2 fr">
	                       			<a class="btn btn-primary radius" onclick="add_new_charge();" href="javascript:;">增加费用</a>
	                       		</div> 
	                       		</div>
	                       	</div>
	                       <div class="ibox-content">							
						<div class="form-group form-products">
	                   		<div class="ml-30" id="newfindCtn">
	                        <c:forEach items="${specs}" var="spec">
	                  			<div class="rule-con">
	                       			费用名称&nbsp;&nbsp;<input type='text'
													class='form-control' style='width: 10%'
													name='chargenames' value="${spec.price_name}" datatype='*1-50' nullmsg='不能为空并且不得超过50个字符'
													>&nbsp;&nbsp;
	                       			金额&nbsp;&nbsp;<input type='text'
													class='form-control' style='width: 10%'
													name='chargefees' value="${spec.price}" nullmsg='不能为空并且必须是两位小数或整数'
													>&nbsp;&nbsp;元&nbsp;&nbsp;
	                       			人数上限&nbsp;&nbsp;<input type='text'
													class='form-control' style='width: 10%'
													name='chargelimits' value="${spec.limit}" datatype='n1-10' nullmsg='不能为空并且必须是整数'
													>&nbsp;&nbsp;操作&nbsp;&nbsp;<span class="c-red">*</span>
									 <a style="text-decoration: none" class="btn btn-primary radius"
										onClick="deleteProductForm(this);"
										href="javascript:;" title="删除">删除</a>
								</div>
							</c:forEach>
							</div>
						</div>
					</div>		
	                       
	                       <div class="form-group">
								<div class="col-sm-4 col-sm-offset-2">
									<button onClick="u_discover_save_submit();"
										class="btn btn-primary radius" type="submit">
										 保存并提交
									</button>
									&nbsp;&nbsp;
									<button  class="btn btn-white" type="button" onclick="layer_close()">
									 取消</button>
								</div>
							</div>
	                    </div>
		            </div>
	            </form>
				
			</div>
		</div>
	</div>
		
	
	
	<script src="${ctx}/static/js/uthinkjs/jquery.js"></script>
	<script src="${ctx}/static/js/bootstrap.min.js"></script>
	<!-- 插件脚本 -->
	<script src="${ctx}/static/js/plugins/layer/layer.js"></script>	
	<script src="${ctx}/static/js/jquery.form.js"></script>
	<script src="${ctx}/static/js/plugins/webuploader/webuploader.min.js"></script>
	<script src="${ctx}/static/js/plugins/validate/jquery.validate.min.js"></script>
	<script src="${ctx}/static/js/Validform/5.3.2/Validform.min.js"></script>
	<script src="${ctx}/static/js/plugins/dataTables/jquery.dataTables.js"></script>
	<script src="${ctx}/static/js/plugins/dataTables/dataTables.bootstrap.js"></script>	
	<script src="${ctx}/static/js/plugins/validate/messages_zh.min.js?v=${static_version}"></script>
	
    	<!-- 地区控件资源 -->
	<script type="text/javascript"
		src="${ctx}/static/plugins/region/js/city-picker.data.js"></script>
	<script type="text/javascript"
		src="${ctx}/static/plugins/region/js/city-picker.js"></script>
	<script type="text/javascript"
		src="${ctx}/static/plugins/region/js/main.js"></script>
	<script
		src="${ctx}/static/js/plugins/datapicker/bootstrap-datepicker.js"></script>
	<script src="${ctx}/static/js/My97DatePicker/WdatePicker.js?v=${static_version}"></script>
	<script type="text/javascript" src="${ctx}/static/js/plugins/markdown/markdown.js"></script>
    <script type="text/javascript" src="${ctx}/static/js/plugins/markdown/to-markdown.js"></script>
    <script type="text/javascript" src="${ctx}/static/js/plugins/markdown/bootstrap-markdown.js"></script>
    <script type="text/javascript" src="${ctx}/static/js/plugins/markdown/bootstrap-markdown.zh.js"></script>
	<script src="${ctx}/static/js/uthinkjs/discover.js"></script>
<script> 


function u_discover_save_submit(){
	
	$("#member_table_form").Validform({
		tiptype:2,
		ajaxPost:true,
		callback:function(form){
			var index = parent.layer.getFrameIndex(window.name);
			if (index){//关闭弹出层
				parent.$('.btn-refresh').click(); 
				parent.layer.close(index);
			}else{//单独的页面
				location.href = "${ctx}/service_discover-list"; 
			}
		}
	});
}



</script>
	
</html>